package com.example.myapplication1;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import com.example.ipcdemo.IUserSingleton;
import com.example.ipcdemo.UserInfo;
import com.example.lib_ipc.core.UserBinderIPC;

public class MainActivity extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        UserBinderIPC.getInstance().open(this,"com.example.ipcdemo");

    }

    public void start(View view) {
        //IUserSingleton 包名要跟主工程包名保持一致
        IUserSingleton instance = UserBinderIPC.getInstance().getInstance(IUserSingleton.class,"haha");

        UserInfo userInfo = instance.getUserInfo();
        Toast.makeText(this, "userInfo:" + userInfo.toString(), Toast.LENGTH_SHORT).show();

    }
}